﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title></title>
    <style type="text/css">
    #map
    {
    	height:440px;
    	width:615px;
    }
    </style>
  
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="google-maps-3-vs-1-0.js"> </script>
    <script type="text/javascript">
       	var map = null;
       	var markersArray = [];
       	
        function ShowMap() {
            // Creating a reference to the mapDiv
            var mapDiv = document.getElementById('map');
            var latlng = new google.maps.LatLng(10.776226122719123, 106.70354515314102);
            var options = {
                center: latlng,
                zoom: 12,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            // Creating the map
            map = new google.maps.Map(mapDiv, options);
            geocoder = new google.maps.Geocoder();
        }

		function GoTo(_lat, _lng, _zoom) {
            map.setCenter(new google.maps.LatLng(_lat,_lng), _zoom);
        }

        function DbClickMarker(_lat, _lng) {
            var zoomLevel = map.getZoom();
            map.setCenter(new google.maps.LatLng(_lat, _lng), zoomLevel);
            map.setZoom(zoomLevel + 1);
        }

		function AddMarker(_lat, _lng, _isHotel, _name, _address, _detail, _img){
			var latlng = new google.maps.LatLng(_lat, _lng);
			var image = "";
			if(_isHotel == true)
				image = "HotelMarker.png";
			else	
				image = "BankMarker.png";
			var marker = new google.maps.Marker({
			position: latlng, 
			map: map, 
			title: _name,
			icon: image
		    });
		    google.maps.event.addListener(marker, 'click', function () {
		        if (_isHotel) {
		            window.external.DisplayInfoHotel(_name, _address, _detail, _img);
		            window.external.GetLatLngHotel(_lat, _lng);
		        }
		        else
		            window.external.DisplayInfoATM(_name, _address, _detail, _img);
            });
            google.maps.event.addListener(marker, 'dblclick', function () {
                DbClickMarker(_lat, _lng);
            });
            markersArray.push(marker);
        }

        function ClearMarker() {
            if (markersArray) {
                for (i in markersArray) {
                    markersArray[i].setMap(null);
                }
                markersArray.length = 0;
            }
		};
    </script>
	</head>
	<body style="background-color:White; margin:0;" onload="ShowMap();">
	    <div id="map"></div>
	</body>
</html>